package com.test.reggieadmin.model.login;

import com.test.reggieadmin.base.BaseObserver;
import com.test.reggieadmin.base.BasePresenter;
import com.test.reggieadmin.bean.EmployeeBean;

import java.util.Map;

public class LoginPrensenter extends BasePresenter<LoginView> {
    public LoginPrensenter(LoginView baseView) {
        super(baseView);
    }

    /**
     * 登录
     *
     * @param map
     */
    public void login(Map<String, Object> map) {
        addDisposable(apiServer.login(map), new BaseObserver<EmployeeBean>() {
            @Override
            public void onSuccess(EmployeeBean bean) {
                baseView.loginData(bean);
            }

            @Override
            public void onError(String msg) {
                baseView.onError(msg);
            }
        });
    }
}
